import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { HomeComponent } from './home/home.component';
import { StartComponent } from './home/start/start.component';
import {TeamStartComponent} from "./home/team-minute/team-start/team-start.component";
import {TeamPackageComponent} from "./home/team-minute/team-package/team-package.component";
import {ModifyDuplicateComponent} from "./home/modify-duplicate/modify-duplicate.component";
import {EnterGuard} from "./my-guard/enter.guard";

export const routes: Routes = [
  //首页
  {
    path: 'home', component: HomeComponent, data: { menu: 'home' },canActivate: [EnterGuard],
    children: [
      { path: 'start', component: StartComponent, data: { menu: 'home', submenu: 'start' } },
      { path: '', redirectTo: 'start', pathMatch: 'full' },
      {
        path:'package',component:TeamPackageComponent
      },
      {
        path:'minute',component:TeamStartComponent,
      },
      {
        path:'modify',component:ModifyDuplicateComponent
      }

    ]
  },
  { path: '', redirectTo: 'home', pathMatch: 'full' }
];
@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule],
  providers: [
    EnterGuard
  ]
})
export class AppRoutingModule { }
